package com.kapo.egroup.entity.base.user;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;

import java.io.Serializable;
import java.util.Date;

/**
 * @Title User
 * @Description TODO
 * @Author 86159
 * @Date 2022-10-11 19:19
 **/
@Getter
@Setter
@JsonInclude(JsonInclude.Include.NON_NULL)
@TableName("user")
public class User implements Serializable {

    /*
     * 用户id
     */
    @Id
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    /*
     * 手机号
     */
    private String phone;

    /*
     * 邮箱
     */
    private String email;

    /*
     * 昵称
     */
    private String nickname;

    /*
     * 密码
     */
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String password;

    /*
     * 学号
     */
    private String studentId;

    /*
     * 头像
     */
    private String avatar;

    /*
     * 专业id
     */
    private Integer majorId;

    /*
     * 学院id
     */
    private Integer schoolId;

    /*
     * 微信号
     */
    private String wechatNumber;

    /*
     * 性别
     */
    private String gender;


    /*
     * 删除状态
     */
    @JsonIgnore
    private Integer deleted;

    /*
     * 创建日期
     */
    @JsonIgnore
    private Date createTime;

    /*
     * 修改日期
     */
    @JsonIgnore
    private Date updateTime;


    /*
     * toString函数
     */
    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", nickname='" + nickname + '\'' +
                ", password='" + password + '\'' +
                ", avatar='" + avatar + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", majorId=" + majorId +
                ", schoolId=" + schoolId +
                ", deleted=" + deleted +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
